//
//  MCCountdownViewController.swift
//  MCComponentFunction_Example
//
//  Created by 满聪 on 2019/7/3.
//  Copyright © 2019 CocoaPods. All rights reserved.
//

import UIKit

import MCComponentFunction

class MCCountdownViewController: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()

    }
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        // countDown.mc_open(start: "2018-01-01 11:11:11", end: "2018-01-01 11:11:15")
        
        countDown.mc_open(allSecondsTime: 10)
    }
    
    lazy var countDown: MCCountdown = {
        let mc = MCCountdown()
        mc.delegate = self
        return mc
    }()
}


extension MCCountdownViewController: MCCountdownDelegate {
    
    func countdown(_ countdown: MCCountdown, ongoingTime time: MCCountdownStruct) {
        print(time )
    }
    
    func countdownEnd(_ countdown: MCCountdown) {
        print("end")
        
    }
    
    func countdownStart(_ countdown: MCCountdown) {
        print("start")
        
    }
    
}
